Skip to content

upcoming: [M3-9829] - Refactor AddLinodeDrawer to remove useEffect #12220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 29, 2025

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented May 14, 2025

Description 📝

  • Updates AddLinodeDrawer to remove useEffect >>> huge kudos + thanks to Banks for the POC! this builds heavily off that
  • Adds ability to assign multiple firewalls to an entity from the Firewall details page - this functionality always existed in the API, now bringing a bit of parity to CM
  • Update Linode Interface table to have a 'Show More' if there exist additional firewalls

FOLLOW UP: M3-9984 to continue supporting multiple firewall functionality
RELATED: M3-9884

Changes 🔄

  • Add ability to assign multiple firewalls for all device types (linode, interface, nodebalancer)
  • add util function + tests to determine if firewall can be assigned to entity (util function only takes into account firewall status + existing devices, not stuff like read only linodes/entities. additional filtering done in the drawers)
  • refactored AddLinodeDrawer to remove useEffect

Preview 📷

there should be no visual changes (besides comment below)
Functionality changes - see video

Before After
cannot-multi-assign.mov
can-multi-assign.mov

image

Before After
image image

How to test 🧪

To test Linode Interface stuff, you'll need the tag + feature flag

Verification steps

Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

Comment on lines 277 to 280
if (linodesNeedingInterfaceSelection.length > 0) {
interfaceError =
'You must select an interface to assign to this Firewall.';
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the one visual/functionality difference for adding interfaces that (should - unless there are bugs 🤞) exists between this version and the old is that now, if we select a LInode but don't select a corresponding interface, we receive an error (instead of submit button being disabled):

Before After
image image

this aligns behavior with other drawers/forms in CM a bit more (submitting + receiving error back), but I can look into changing back to disabling the button if wanted!

Comment on lines 180 to 184
const linodesNeedingInterfaceSelection =
selectedLinodesWithMultipleInterfaces.filter(
(linode) => !selectedIfacesToAdd[linode.id]
);
const failedLinodes: Linode[] = [...linodesNeedingInterfaceSelection];
Copy link
Contributor Author

@coliu-akamai coliu-akamai May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we've selected a Linode with multiple eligible interfaces, haven't selected an interface for that Linode, and click add, no interface device gets added for those Linodes. So, we will save them for the next attempt and display a message to select the interfaces

@coliu-akamai coliu-akamai marked this pull request as ready for review May 14, 2025 22:13
@coliu-akamai coliu-akamai requested a review from a team as a code owner May 14, 2025 22:13
@coliu-akamai coliu-akamai requested review from hana-akamai, hasyed-akamai and bnussman-akamai and removed request for a team May 14, 2025 22:13
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality seems to be working as expected

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels May 20, 2025
@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager May 21, 2025
@hasyed-akamai hasyed-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels May 21, 2025
@coliu-akamai coliu-akamai marked this pull request as draft May 27, 2025 13:30
@coliu-akamai
Copy link
Contributor Author

putting this back in draft - after PM feedback, will need to update this to not include multi-firewall assigning ability

@coliu-akamai coliu-akamai changed the title upcoming: [M3-9829] - Refactor AddLinodeDrawer and add support for assigning multiple firewalls upcoming: [M3-9829] - Refactor AddLinodeDrawer to remove useEffect May 27, 2025
@coliu-akamai coliu-akamai marked this pull request as ready for review May 29, 2025 14:34
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 2 failing tests on test run #14 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing607 Passing6 Skipped117m 13s

Details

Failing Tests
SpecTest
access-key.e2e.spec.tsCloud Manager Cypress Tests→object storage access key end-to-end tests » object storage access key end-to-end tests
create-stackscripts.spec.tsCloud Manager Cypress Tests→Create stackscripts » Create stackscripts

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/objectStorage/access-key.e2e.spec.ts,cypress/e2e/core/stackscripts/create-stackscripts.spec.ts"

@coliu-akamai coliu-akamai merged commit 3583a12 into linode:develop May 29, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Firewalls Related to Firewalls Linode Interfaces
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants